setwd("C:/Users/arcaroadmin/Dropbox/2020 Bio697GA/Assignment 4")
SNPs <- read.table("23andMe_complete.txt", header = TRUE, sep = "\t")
library(ggplot2)
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(DT)
ggplot(SNPs, aes(x=chromosome)) + geom_bar(fill = "blue")
ggplot(SNPs, aes(x=chromosome, fill = genotype)) + geom_bar(color = "black") + xlab("Chromosomes") + ylab("Genotypes") + ggtitle("Lab 4, Exercise 2") + scale_fill_manual(values = c("black", "blue", "green", "green", "green", "green", "blue", "green", "green", "green", "red", "red", "red", "blue", "green", "green", "red", "red", "blue", "green"))
Lab 4, Exercise 3
ggplot(SNPs, aes(x=genotype, fill = chromosome)) + geom_bar(color = "black") + coord_polar() + facet_wrap(~chromosome) + xlab("Genotype broken down for each chromosome") + ylab("Genotype count") + ggtitle("Lab 4, Exercise 4")
ggplotly(ggplot(SNPs, aes(x=genotype, fill = chromosome)) + geom_bar(color = "black") + facet_wrap(~chromosome) + theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5), text = element_text(size=7)) + xlab("Genotype broken down for each chromosome") + ylab("Genotype count") + ggtitle("Lab 4, Exercise 4"))
SNPs_Y <- subset(SNPs, chromosome == "Y")
datatable(SNPs_Y)
## Warning in instance$preRenderHook(instance): It seems your data is too big
## for client-side DataTables. You may consider server-side processing: https://
## rstudio.github.io/DT/server.html